<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function Student(username, age) {
      // 1. 创建空对象
      // 2. this指向控对象
      //      var this =  {}

      // 3. 正常执行往 this这个对象里 丢东西
      this.username = username
      this.age = age
      this.fn = function(info) {
        console.log(info)
      }
      // 4. 返回这个对象
      // return this
    }

    var ldh = new Student('刘德华', 18)

    console.log(ldh)
  </script>
</body>
</html>